<?php
declare (strict_types=1);

namespace app\course\service\base\admin;

use app\common\service\BaseService;
use app\course\logic\base\admin\Schedule as ScheLogic;
use eduline\admin\libs\pageform\FormItem;
use eduline\admin\page\PageList;
use think\annotation\Inject;
use think\facade\Request;

class Schedule extends BaseService
{

    /**
     * @Inject()
     * @var ScheLogic
     */
    protected $scheLogic;

    public function getDailySchedule()
    {
        $param = Request::get();
        $datas = $this->scheLogic->getDailySchedule($param);

        $searchKey = [
            'title'   => FormItem::make()->title(false)->placeholder('输入直播课名称')->maxlength(30),
            'teacher' => FormItem::make()->title(false)->placeholder('请输入讲师名称')->maxlength(30),
        ];

        // 设置表单
        $list            = new PageList();
        $list->searchKey = $searchKey;
        $list->datas     = $datas;

        return $list->send();
    }

    public function getPeriodSchedule()
    {
        $param = Request::get();
        $datas = $this->scheLogic->getPeriodSchedule($param);

        $searchKey = [
            'title'   => FormItem::make()->title(false)->placeholder('输入直播课名称')->maxlength(30),
            'teacher' => FormItem::make()->title(false)->placeholder('请输入讲师名称')->maxlength(30),
        ];

        // 设置表单
        $list            = new PageList();
        $list->searchKey = $searchKey;
        $list->datas     = $datas;

        return $list->send();
    }
}
